package com.lanou3g.code0512.homework;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * If there are no bugs, it was created by Chen FengYao on 2018/5/12;
 * Otherwise, I don't know who created it either
 */

@WebServlet(name = "AServlet", urlPatterns = "/a")
public class AServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response) throws ServletException, IOException {
        response.addHeader("Content-Type",
                "text/html;charset=utf-8");

        response.setHeader("refresh","5;url=/b");
        response.getWriter()
                .println("<a href=\"/b\">点击</a>");
    }
}
